<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算结果页面</title>
    <script src="./jquery.min.js"></script>
</head>
<body>
<h1>
    计算结果：<span id="result"></span>
</h1>
<script>
    $.ajax({
        type:"post",
        url:"calc/getParam",
        success:function(result){
            var num1=result.num1;
            var num2=result.num2;
            sum(num1,num2);
        }
    });

    function sum(num1,num2){
        $.ajax({
            type:"get",
            url:"/calc/sum",
            data:{
                "num1":num1,
                "num2":num2,
            },
            success:function(result){
                $("#result").text(result);
            }
        });
    }
</script>
</body>
</html>